package com.googlecode.contests_repo.cmd.tools;

import java.io.IOException;

import com.googlecode.contests_repo.core.users.UserManager;

/**
 * Command-line tool the administrator can use to validate user data.
 * 
 * @author deni, joro
 */
public class UserValidator {
	
	/**
	 * Validates the user data in the given file and prints the result.
	 * 
	 * @param args
	 * 		the root of the repository file system
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		if (args == null || args.length != 1) {
			System.out.println("Usage: validateusers <user-file>");
			return;
		}
		
		String repoRoot = args[0];
		UserManager.validateAllUsers(repoRoot);
	}

}
